-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Alert Feature for Unsaved Changes in Editor #79
Conversation
@@ -37,16 +41,19 @@ async function start_editor() { | |||
|
|||
} else { | |||
status_error(); | |||
log("WARNING", "There was a problem") | |||
create_notification("There was a problem", "There was an unknown issue", "warning"); | |||
log("WARNING", "There was a problem"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatter being naughty. 😅
Hey @mSaurabh, thanks for working on this! I attempted to test out the new feature but it appears that most of the static files couldn't be loaded anymore
Is this happening for you too or is this just some kind of error on my side? I'm not sure why this is occurring as you've not committed to anything besides |
I think ar4s added some ruff changes that I pulled from master branch before creating my PR that might be causing these errors @nfoert |
This pull request implements the "Better Save" feature (issue #11) by introducing an alert mechanism that warns users of unsaved changes when attempting to leave the screen without saving their content. The changes are contained within the editor.js file.
Changes:
Added a new alert feature that triggers when the user attempts to navigate away from the editor screen without saving their changes.
Implemented a check to detect unsaved changes and display a confirmation prompt to the user.
Related Issues:
Closes #11: Better Save feature implementation
Notes:
This implementation uses a flag called
prevent_save
and functioncheckForUnsavedChanges
to check for unsaved changes. Also added abeforeunload
event listener to make changes to prevent_save flag based on user choice.